//logs.js
const util = require('../../utils/util.js')
const recordService = require('../../services/recordService.js')
const sharedService = require('../../services/sharedService.js')

Page({
  data: {
    logs: []
  },
  onLoad: function () {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })
  },
  onShareAppMessage: function(options){
    return sharedService.onShareAppMessage(options, function() {
      recordService.get()
    });
  },
})
